using UnityEngine;

public class RocketLeagueBallShadow : MonoBehaviour
{
	public Transform ballTransform;

	public float pos = 2.2f;

	public LayerMask mask;

	private Vector3 newShadowUp = Vector3.up;

	private Vector3 currentShadowUp = Vector3.up;

	private void Update()
	{
		RaycastHit hitInfo;
		if (Physics.Raycast(ballTransform.position, -Vector3.up, out hitInfo, 150f, mask))
		{
			base.transform.position = hitInfo.point + hitInfo.normal * pos;
			newShadowUp = hitInfo.normal;
		}
		currentShadowUp = Vector3.Lerp(currentShadowUp, newShadowUp, Time.deltaTime * 15f);
		base.transform.up = currentShadowUp;
	}
}
